﻿using System;
using System.Collections.Generic;
using System.Text;
using StringUtilHelp;

namespace StringUtilHelpV2Plus
{
    public class StringToolV2Plus
    {
        public static bool CheckLengthDivisible(string str, int divisibleValue)
        {
            try
            {
                if (string.IsNullOrEmpty(str))
                    throw new ArgumentNullException("str");
                if (divisibleValue <= 0)
                    throw new ArgumentException("divisibleValue");
                str = StringToolV2.ClearBlank(str);
                return (str.Length % divisibleValue) == 0;
            }
            catch (ArgumentNullException ex)
            {
                throw ex;
            }
            catch (ArgumentException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("CheckLengthDivisible Exception:{0}", ex.Message.Trim()));
            }
        }
    }
}
